
	function openEditModal() { 
    	
    	const modal = document.getElementById("edit-modal");   
        modal.style.display = "flex";
         
        // 点击弹窗外部关闭
        modal.addEventListener("click", function(event) {
            if (event.target === modal) {
                closeModal();
            }
        });
        
        // 按ESC键关闭弹窗
        document.addEventListener("keydown", function(event) {
            if (event.key === "Escape" && modal.style.display === "flex") {
                closeModal();
            }
        });
        
    }
	
	
	function openEditModalById(mid) { 
	    	
	    	const modal = document.getElementById(mid);   
			if(modal == null){
				return;
			}
	        modal.style.display = "flex";
	         
	        // 点击弹窗外部关闭
	        modal.addEventListener("click", function(event) {
	            if (event.target === modal) {
	                closeModal();
	            }
	        });
	        
	        // 按ESC键关闭弹窗
	        document.addEventListener("keydown", function(event) {
	            if (event.key === "Escape" && modal.style.display === "flex") {
	                closeModal();
	            }
	        });
	        
	    }
    
    //关闭弹窗
    function closeModal() {
    	const modal = document.getElementById("edit-modal"); 
        modal.style.display = "none";
    } 
	
	function closeModalById(mid) {
	    const modal = document.getElementById(mid); 
		if(modal != null){
			modal.style.display = "none";
		} 
	} 